import java.util.Stack;

import org.w3c.dom.Node;

public class inOrderTraversalNonRecursive{
	
	private Node current;
	private Stack<E> stack;
	public inOrderTraversalNonRecursive(){
		current = new Node("root");
		stack = new Stack();
		createTree();
		
		while(current != NULL || stack != NULL){
			if(current != NULL){
				stack.push(current);
				current = current.getFirstChild();
			}
			else{
				System.out.println(current.getNodeValue());
				current=stack.pop();
				current=stack.getLastChild();
			}
		}
		
		
	}
	
	public void createTree(){
		leftNode = new Node();
		richtNode = new Node();
		
		leftLeaf = "leftLeaf";
		rightLeaf = "rightLeaf";
		
		current.addChild(leftLeaf, leftNode);
		current.addChild(rightLead, rightNode);		
	}
}